﻿using System.Web.Mvc;
using SharePointEditor.BusinessDefinitions.Interfaces;
using SharePointEditor.Web.Helpers;
using SharePointEditor.Web.Models;

namespace SharePointEditor.Web.Controllers
{
    [HandleError]
    public class HomeController : BaseController
    {
        private ISPDataService _service;

        public HomeController(ISPDataService service)
        {
            _service = service;
        }

        public ActionResult Index()
        {
            var model = new SharePointEditorModel
                            {
                                SiteNavigationModel =
                                    new SiteNavigationModel
                                        {
                                            WebApplication = _service.GetWebApplication()
                                        }
                            };
            return View(model);
        }
    }
}
